﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    /*
     * 
        Original code:

        if (guid != Guid.Empty) return guid;
        else return Guid.NewGuid();
        New code:

        return guid.NewGuidIfEmpty();
     */

    public static partial class GuidExtensions
    {
        public static Guid NewGuidIfEmpty(this Guid uuid)
        {
            return (uuid != Guid.Empty ? uuid : Guid.NewGuid());
        }
    }
}
